package com.book.core.domain;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.Date;

import com.book.core.mode.UpdateGroup;
import lombok.Data;

import javax.validation.constraints.Max;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;

/**
 * 读者限制表
 * @TableName reader_restrictions
 */
@TableName(value ="reader_restrictions")
@Data
public class ReaderRestrictions implements Serializable {
    /**
     *
     */
    @TableId(type = IdType.AUTO)
    @NotNull(message = "限制编号不能为空", groups = {UpdateGroup.class})
    private Long restrictionId;

    /**
     * 读者编号
     */
    @NotNull(message = "读者编号不能为空")
    private Long readerId;

    /**
     * 借阅编号
     */
    @NotNull(message = "借阅编号不能为空")
    private Long recordId;

    /**
     * 1-逾期限制, 2-其他限制
     */
    @Min(value = 1, message = "限制类型值不能小于1")
    @Max(value = 2, message = "限制类型值不能大于2")
    private Integer restrictType;

    /**
     * 限制天数
     */
    private Long restrictDays;

    /**
     * 限制开始日期
     */
    private LocalDateTime startDate;

    /**
     * 限制结束日期
     */
    private LocalDateTime endDate;

    /**
     * 限制原因
     */
    private String reason;

    /**
     * 创建时期
     */
    private LocalDateTime createdTime;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;
}
